package code

const (
	ServerError        = 10101
	ParamBindError     = 10102
	JWTAuthVerifyError = 10103
	//DBQueryError 数据库查询错误
	DBQueryError = 10104
	//DBInsertError 数据库插入错误
	DBInsertError = 10105
	//DBUpdateError 数据库更新错误
	DBUpdateError = 10106
	//DBDeleteError 数据库删除错误
	DBDeleteError = 10107
	//DBInsertSuccess 数据库插入成功
	DBInsertSuccess = 10108
	//DBDeleteSuccess 数据库删除成功
	DBDeleteSuccess = 10109
	//数据库查询成功
	DBQuerySuccess = 10110
	//记录不存在
	RecordNotExist = 10111
	//Jwt 授权认证失败
	JwtAuthFail = 10112
	//账号或密码错误
	AccountOrPasswordError = 10113
	//登录失败
	LoginFail = 10114
	//登录成功
	LoginSuccess = 10115
	//JWT生成失败
	JwtGenerateFail = 10116
	//JWT已经过期
	JwtExpired = 10117
)

func GetMsg(code int, lang string) string {
	switch lang {
	case "zh-cn":
		return zhCNText[code]
	case "en-us":
		return enUSText[code]
	default:
		return zhCNText[code]
	}
}
